package com.xz.knowledgeDuplication.pattern.combination;

/**
 * 文件项(叶子节点)
 *
 * @author 召
 * @date 2022-03-13 21:55:03
 */
public class MenuItem extends MenuComponent{

    public MenuItem (String name, int level) {
        this.name = name;
        this.level = level;
    }

    @Override
    public void print() {
        for (int i = 0; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(this.name);
    }
}
